/*
 *  POJ1014: Dividing
 */

/*-------- Includes --------*/
#include <iostream>
#include <cstring>

using namespace std;

/*-------- Defines --------*/


/*-------- Types --------*/


/*-------- Global Variables --------*/
int half;
int num[7];

int dp[60001];
int ct[60001];

/*-------- Function Prototypes --------*/


/*-------- Main Function --------*/
int main(int argc, char const *argv[])
{
    int kCase = 1;

    while (true) {
        // get input
        for (int i = 1; i < 7; i++) cin >> num[i];

        // value of half
        half = 0;
        for (int i = 1; i < 7; i++) half += i * num[i];

        // six zero
        if (half == 0) break;

        // print title
        cout << "Collection #" << kCase++ << ':' << endl;

        if (half % 2) {
            cout << "Can't be divided." << endl << endl;
            continue;
        }

        half /= 2;

        // allocate memory
        // dp = new int[half + 1];
        // ct = new int[half + 1];

        memset(dp, 0, (half + 1) * sizeof(int));

        // dynamic programming
        for (int i = 1; i < 7; i++) {
            if (num[i] == 0) continue;

            memset(ct, 0, (half + 1) * sizeof(int));

            for (int j = i; j <= half; j++) {
                if (dp[j] < dp[j - i] + i && ct[j - i] < num[i]) {
                    dp[j] = dp[j - i] + i;
                    ct[j] = ct[j - i] + 1;
                }
            }
        }

        // print result
        if (dp[half] == half) cout << "Can be divided."   << endl << endl;
        else                  cout << "Can't be divided." << endl << endl;

        // release memory
        // delete dp;
        // delete ct;
    }
}

/*-------- Functions --------*/

